
class Distribute():
    def __init__(self, plan_n = 5, expe_n = 5, attr_n =5 ,
                 data=[], expert=[],attri=[], *waste1, **waste2):
        """
            function : 初始化函数
        """
        self.data = data
        self.expert = expert
        self.attri = attri

        self.size = [expe_n, plan_n, attr_n] # 随机数时候用的

        # 初始化的评价指标
        # 数值评分映射的区间值广义正交模糊数
        # 不要出现 0.0 和 1.0 对于 log，x**q 来说会出现 math domain 的错误
        self.data_dict = {
            0: ([0.01, 0.10], [0.90, 0.99]),
            1: ([0.10, 0.20], [0.80, 0.90]),
            2: ([0.20, 0.35], [0.65, 0.80]),
            3: ([0.35, 0.45], [0.55, 0.65]),
            4: ([0.45, 0.55], [0.45, 0.55]),
            5: ([0.55, 0.65], [0.35, 0.45]),
            6: ([0.65, 0.80], [0.20, 0.35]),
            7: ([0.80, 0.90], [0.10, 0.20]),
            8: ([0.90, 0.95], [0.05, 0.10]),
            9: ([0.95, 0.99], [0.01, 0.05])
        }
        # 数字评分代表的意思
        self.meaning_dict = {
            0: "Certainly low important (CLI)",
            1: "Very low important(VLI)",
            2: "Low important(LI)",
            3: "Below average important (BAI)",
            4: "Average important(AI)",
            5: "Above average important(AAI)",
            6: "High important(HI)",
            7: "Very high important(VHI)",
            8: "Certainly high important(CHI)",
            9: "More Certainly high important(MCHI)",
            10: "Exactly equal(EE)"
        }
        # 评级的分数区间
        self.data_assess_value = []

        # 默认使用均匀分布分布和接近的权重
        self.get_Uniform_random(show_distri=False)

    def getResult(self, show_result=True, *waste1, **waste2):
        """
            function : 返回案例数据
            return   : 返回 (data, weight_ex, weight_attri) 的集合, 可以用 * 来解压列表
        """
        # 输出结果矩阵
        if show_result:
            self.show_array(self.data)

        return self.data, self.expert, self.attri

    # 使用案例数据集

    def get_Gaussian_case(self):
        """
            function : 正态分布（均值=0.5，方差=0.5）的数据，5个方案，5个专家，5个属性
            remark   : 正态分布（均值=0.5，方差=0.5）的数据，5个方案，5个专家，5个属性
            return   : 正态分布的 5 x 5 x 5 的数据案例，以及专家权重和属性权重
        """
        # self.data = [
        #     [   # EX 1
        #         [([0.83618, 0.91809], [0.08191, 0.16382]), ([0.31409, 0.42606], [0.57394, 0.68591]), ([0.35865, 0.45865], [0.54135, 0.64135]), ([0.31958, 0.42972], [0.57028, 0.68042]), ([0.82832, 0.91416], [0.08584, 0.17168])],
        #         [([0.15235, 0.27852], [0.72148, 0.84765]), ([0.58754, 0.70631], [0.29369, 0.41246]), ([0.38481, 0.48481], [0.51519, 0.61519]), ([0.47759, 0.57759], [0.42241, 0.52241]), ([0.22139, 0.36426], [0.63574, 0.77861])],
        #         [([0.33162, 0.43775], [0.56225, 0.66838]), ([0.24469, 0.37979], [0.62021, 0.75531]), ([0.3575, 0.4575], [0.5425, 0.6425]), ([0.45444, 0.55444], [0.44556, 0.54556]), ([0.54304, 0.64304], [0.35696, 0.45696])],
        #         [([0.25124, 0.38416], [0.61584, 0.74876]), ([0.51559, 0.61559], [0.38441, 0.48441]), ([0.69767, 0.83178], [0.16822, 0.30233]), ([0.4922, 0.5922], [0.4078, 0.5078]), ([0.34315, 0.44543], [0.55457, 0.65685])],
        #         [([0.80312, 0.90156], [0.09844, 0.19688]), ([0.54141, 0.64141], [0.35859, 0.45859]), ([0.36238, 0.46238], [0.53762, 0.63762]), ([0.55207, 0.65311], [0.34689, 0.44793]), ([0.21361, 0.35907], [0.64093, 0.78639])]
        #     ],
        #     [   # EX 2
        #         [([0.83618, 0.91809], [0.08191, 0.16382]), ([0.31409, 0.42606], [0.57394, 0.68591]), ([0.35865, 0.45865], [0.54135, 0.64135]), ([0.31958, 0.42972], [0.57028, 0.68042]), ([0.82832, 0.91416], [0.08584, 0.17168])],
        #         [([0.15235, 0.27852], [0.72148, 0.84765]), ([0.58754, 0.70631], [0.29369, 0.41246]), ([0.38481, 0.48481], [0.51519, 0.61519]), ([0.47759, 0.57759], [0.42241, 0.52241]), ([0.22139, 0.36426], [0.63574, 0.77861])],
        #         [([0.33162, 0.43775], [0.56225, 0.66838]), ([0.24469, 0.37979], [0.62021, 0.75531]), ([0.3575, 0.4575], [0.5425, 0.6425]), ([0.45444, 0.55444], [0.44556, 0.54556]), ([0.54304, 0.64304], [0.35696, 0.45696])],
        #         [([0.25124, 0.38416], [0.61584, 0.74876]), ([0.51559, 0.61559], [0.38441, 0.48441]), ([0.69767, 0.83178], [0.16822, 0.30233]), ([0.4922, 0.5922], [0.4078, 0.5078]), ([0.34315, 0.44543], [0.55457, 0.65685])],
        #         [([0.80312, 0.90156], [0.09844, 0.19688]), ([0.54141, 0.64141], [0.35859, 0.45859]), ([0.36238, 0.46238], [0.53762, 0.63762]), ([0.55207, 0.65311], [0.34689, 0.44793]), ([0.21361, 0.35907], [0.64093, 0.78639])]
        #     ],
        #     [   # EX 3
        #         [([0.43425, 0.53425], [0.46575, 0.56575]), ([0.88039, 0.94019], [0.05981, 0.11961]), ([0.41447, 0.51447], [0.48553, 0.58553]), ([0.4476, 0.5476], [0.4524, 0.5524]), ([0.18896, 0.33344], [0.66656, 0.81104])],
        #         [([0.70605, 0.83737], [0.16263, 0.29395]), ([0.5571, 0.66065], [0.33935, 0.4429]), ([0.37665, 0.47665], [0.52335, 0.62335]), ([0.36623, 0.46623], [0.53377, 0.63377]), ([0.06355, 0.1595], [0.8405, 0.93645])],
        #         [([0.1557, 0.28356], [0.71644, 0.8443]), ([0.36183, 0.46183], [0.53817, 0.63817]), ([0.27234, 0.39823], [0.60177, 0.72766]), ([0.65971, 0.80647], [0.19353, 0.34029]), ([0.75115, 0.86743], [0.13257, 0.24885])],
        #         [([0.39504, 0.49504], [0.50496, 0.60496]), ([0.39674, 0.49674], [0.50326, 0.60326]), ([0.64697, 0.79545], [0.20455, 0.35303]), ([0.37263, 0.47263], [0.52737, 0.62737]), ([0.41857, 0.51857], [0.48143, 0.58143])],
        #         [([0.6117, 0.74255], [0.25745, 0.3883]), ([0.62751, 0.76626], [0.23374, 0.37249]), ([0.57758, 0.69137], [0.30863, 0.42242]), ([0.34754, 0.44836], [0.55164, 0.65246]), ([0.5088, 0.6088], [0.3912, 0.4912])]
        #     ],
        #     [   # EX 4
        #         [([0.84547, 0.92273], [0.07727, 0.15453]), ([0.144, 0.266], [0.734, 0.856]), ([0.95, 0.99], [0.01, 0.05]), ([0.65754, 0.80502], [0.19498, 0.34246]), ([0.84036, 0.92018], [0.07982, 0.15964])],
        #         [([0.42873, 0.52873], [0.47127, 0.57127]), ([0.13042, 0.24562], [0.75438, 0.86958]), ([0.78335, 0.8889], [0.1111, 0.21665]), ([0.92359, 0.96887], [0.03113, 0.07641]), ([0.05902, 0.15447], [0.84553, 0.94098])],
        #         [([0.6474, 0.7961], [0.2039, 0.3526]), ([0.76209, 0.87472], [0.12528, 0.23791]), ([0.41213, 0.51213], [0.48787, 0.58787]), ([0.41519, 0.51519], [0.48481, 0.58481]), ([0.56539, 0.67308], [0.32692, 0.43461])],
        #         [([0.22797, 0.36864], [0.63136, 0.77203]), ([0.85487, 0.92744], [0.07256, 0.14513]), ([0.43941, 0.53941], [0.46059, 0.56059]), ([0.131, 0.24649], [0.75351, 0.869]), ([0.27968, 0.40312], [0.59688, 0.72032])],
        #         [([0.54231, 0.64231], [0.35769, 0.45769]), ([0.37227, 0.47227], [0.52773, 0.62773]), ([0.38045, 0.48045], [0.51955, 0.61955]), ([0.52091, 0.62091], [0.37909, 0.47909]), ([0.14078, 0.26117], [0.73883, 0.85922])],
        #     ],
        #     [   # EX 5
        #         [([0.35428, 0.45428], [0.54572, 0.64572]), ([0.0765, 0.17389], [0.82611, 0.9235]), ([0.77216, 0.88144], [0.11856, 0.22784]), ([0.4368, 0.5368], [0.4632, 0.5632]), ([0.7187, 0.8458], [0.1542, 0.2813])],
        #         [([0.32921, 0.43614], [0.56386, 0.67079]), ([0.43519, 0.53519], [0.46481, 0.56481]), ([0.41521, 0.51521], [0.48479, 0.58479]), ([0.50738, 0.60738], [0.39262, 0.49262]), ([0.56076, 0.66615], [0.33385, 0.43924])],
        #         [([0.25606, 0.38737], [0.61263, 0.74394]), ([0.26822, 0.39548], [0.60452, 0.73178]), ([0.52524, 0.62524], [0.37476, 0.47476]), ([0.45266, 0.55266], [0.44734, 0.54734]), ([0.62829, 0.76744], [0.23256, 0.37171])],
        #         [([0.37453, 0.47453], [0.52547, 0.62547]), ([0.14183, 0.26274], [0.73726, 0.85817]), ([0.41044, 0.51044], [0.48956, 0.58956]), ([0.51452, 0.61452], [0.38548, 0.48548]), ([0.53993, 0.63993], [0.36007, 0.46007])],
        #         [([0.46419, 0.56419], [0.43581, 0.53581]), ([0.45675, 0.55675], [0.44325, 0.54325]), ([0.76914, 0.87942], [0.12058, 0.23086]), ([0.66814, 0.81209], [0.18791, 0.33186]), ([0.52111, 0.62111], [0.37889, 0.47889])]
        #     ]
        # ]

        self.data =[
            [  # 第1位专家对每个方案每个属性判断:
                [([0.43139, 0.53139], [0.46861, 0.56861]), ([0.35773, 0.45773], [0.54227, 0.64227]),
                 ([0.6034, 0.73009], [0.26991, 0.3966]), ([0.64622, 0.79433], [0.20567, 0.35378]),
                 ([0.44208, 0.54208], [0.45792, 0.55792])],
                [([0.39202, 0.49202], [0.50798, 0.60798]), ([0.55939, 0.66409], [0.33591, 0.44061]),
                 ([0.38129, 0.48129], [0.51871, 0.61871]), ([0.41573, 0.51573], [0.48427, 0.58427]),
                 ([0.50382, 0.60382], [0.39618, 0.49618])],
                [([0.72886, 0.85257], [0.14743, 0.27114]), ([0.17943, 0.31915], [0.68085, 0.82057]),
                 ([0.54453, 0.64453], [0.35547, 0.45547]), ([0.82692, 0.91346], [0.08654, 0.17308]),
                 ([0.82239, 0.91119], [0.08881, 0.17761])],
                [([0.89288, 0.94644], [0.05356, 0.10712]), ([0.54966, 0.64966], [0.35034, 0.45034]),
                 ([0.77097, 0.88065], [0.11935, 0.22903]), ([0.61366, 0.74549], [0.25451, 0.38634]),
                 ([0.93825, 0.9806], [0.0194, 0.06175])],
                [([0.49904, 0.59904], [0.40096, 0.50096]), ([0.17889, 0.31833], [0.68167, 0.82111]),
                 ([0.33236, 0.43824], [0.56176, 0.66764]), ([0.35801, 0.45801], [0.54199, 0.64199]),
                 ([0.47348, 0.57348], [0.42652, 0.52652])]
            ],
                [  # 第2位专家对每个方案每个属性判断:
                    [([0.6747, 0.81647], [0.18353, 0.3253]), ([0.67274, 0.81516], [0.18484, 0.32726]),
                     ([0.011, 0.10111], [0.89889, 0.989]), ([0.67757, 0.81838], [0.18162, 0.32243]),
                     ([0.51259, 0.61259], [0.38741, 0.48741])],
                    [([0.88811, 0.94405], [0.05595, 0.11189]), ([0.54598, 0.64598], [0.35402, 0.45402]),
                     ([0.73283, 0.85522], [0.14478, 0.26717]), ([0.90471, 0.95377], [0.04623, 0.09529]),
                     ([0.12395, 0.23592], [0.76408, 0.87605])],
                    [([0.60373, 0.73059], [0.26941, 0.39627]), ([0.42479, 0.52479], [0.47521, 0.57521]),
                     ([0.2201, 0.3634], [0.6366, 0.7799]), ([0.40917, 0.50917], [0.49083, 0.59083]),
                     ([0.60004, 0.72506], [0.27494, 0.39996])],
                    [([0.8288, 0.9144], [0.0856, 0.1712]), ([0.94642, 0.98714], [0.01286, 0.05358]),
                     ([0.57575, 0.68862], [0.31138, 0.42425]), ([0.58538, 0.70308], [0.29692, 0.41462]),
                     ([0.70731, 0.8382], [0.1618, 0.29269])],
                    [([0.3713, 0.4713], [0.5287, 0.6287]), ([0.60207, 0.7281], [0.2719, 0.39793]),
                     ([0.3957, 0.4957], [0.5043, 0.6043]), ([0.90347, 0.95278], [0.04722, 0.09653]),
                     ([0.42961, 0.52961], [0.47039, 0.57039])],
                ],
                [  # 第3位专家对每个方案每个属性判断:
                    [([0.69863, 0.83242], [0.16758, 0.30137]), ([0.95, 0.99], [0.01, 0.05]),
                     ([0.011, 0.10111], [0.89889, 0.989]), ([0.65908, 0.80606], [0.19394, 0.34092]),
                     ([0.81504, 0.90752], [0.09248, 0.18496])],
                    [([0.08036, 0.17818], [0.82182, 0.91964]), ([0.47978, 0.57978], [0.42022, 0.52022]),
                     ([0.47393, 0.57393], [0.42607, 0.52607]), ([0.3729, 0.4729], [0.5271, 0.6271]),
                     ([0.4979, 0.5979], [0.4021, 0.5021])],
                    [([0.42119, 0.52119], [0.47881, 0.57881]), ([0.45488, 0.55488], [0.44512, 0.54512]),
                     ([0.3553, 0.4553], [0.5447, 0.6447]), ([0.533, 0.633], [0.367, 0.467]),
                     ([0.72597, 0.85065], [0.14935, 0.27403])],
                    [([0.58412, 0.70117], [0.29883, 0.41588]), ([0.55709, 0.66064], [0.33936, 0.44291]),
                     ([0.61489, 0.74733], [0.25267, 0.38511]), ([0.86958, 0.93479], [0.06521, 0.13042]),
                     ([0.4152, 0.5152], [0.4848, 0.5848])],
                    [([0.37609, 0.47609], [0.52391, 0.62391]), ([0.95, 0.99], [0.01, 0.05]),
                     ([0.85866, 0.92933], [0.07067, 0.14134]), ([0.51308, 0.61308], [0.38692, 0.48692]),
                     ([0.63905, 0.78358], [0.21642, 0.36095])]
                ],
                [  # 第4位专家对每个方案每个属性判断:
                    [([0.17366, 0.31048], [0.68952, 0.82634]), ([0.3767, 0.4767], [0.5233, 0.6233]),
                     ([0.5617, 0.66755], [0.33245, 0.4383]), ([0.76095, 0.87397], [0.12603, 0.23905]),
                     ([0.60943, 0.73915], [0.26085, 0.39057])],
                    [([0.67374, 0.81582], [0.18418, 0.32626]), ([0.50282, 0.60282], [0.39718, 0.49718]),
                     ([0.5994, 0.7241], [0.2759, 0.4006]), ([0.7669, 0.87793], [0.12207, 0.2331]),
                     ([0.75491, 0.86994], [0.13006, 0.24509])],
                    [([0.68047, 0.82032], [0.17968, 0.31953]), ([0.33588, 0.44058], [0.55942, 0.66412]),
                     ([0.14848, 0.27272], [0.72728, 0.85152]), ([0.0553, 0.15033], [0.84967, 0.9447]),
                     ([0.58484, 0.70227], [0.29773, 0.41516])],
                    [([0.27436, 0.39957], [0.60043, 0.72564]), ([0.24495, 0.37996], [0.62004, 0.75505]),
                     ([0.40717, 0.50717], [0.49283, 0.59283]), ([0.16501, 0.29751], [0.70249, 0.83499]),
                     ([0.38297, 0.48297], [0.51703, 0.61703])],
                    [([0.1531, 0.27965], [0.72035, 0.8469]), ([0.37707, 0.47707], [0.52293, 0.62293]),
                     ([0.71648, 0.84432], [0.15568, 0.28352]), ([0.82585, 0.91293], [0.08707, 0.17415]),
                     ([0.54324, 0.64324], [0.35676, 0.45676])]
                ],
                [  # 第5位专家对每个方案每个属性判断:
                    [([0.76505, 0.8767], [0.1233, 0.23495]), ([0.71801, 0.84534], [0.15466, 0.28199]),
                     ([0.54008, 0.64008], [0.35992, 0.45992]), ([0.42757, 0.52757], [0.47243, 0.57243]),
                     ([0.36296, 0.46296], [0.53704, 0.63704])],
                    [([0.49651, 0.59651], [0.40349, 0.50349]), ([0.24003, 0.37669], [0.62331, 0.75997]),
                     ([0.61738, 0.75106], [0.24894, 0.38262]), ([0.16575, 0.29863], [0.70137, 0.83425]),
                     ([0.51531, 0.61531], [0.38469, 0.48469])],
                    [([0.34502, 0.44668], [0.55332, 0.65498]), ([0.38992, 0.48992], [0.51008, 0.61008]),
                     ([0.47065, 0.57065], [0.42935, 0.52935]), ([0.87297, 0.93648], [0.06352, 0.12703]),
                     ([0.54215, 0.64215], [0.35785, 0.45785])],
                    [([0.08572, 0.18413], [0.81587, 0.91428]), ([0.52185, 0.62185], [0.37815, 0.47815]),
                     ([0.4156, 0.5156], [0.4844, 0.5844]), ([0.72198, 0.84799], [0.15201, 0.27802]),
                     ([0.62824, 0.76736], [0.23264, 0.37176])],
                    [([0.83606, 0.91803], [0.08197, 0.16394]), ([0.8944, 0.9472], [0.0528, 0.1056]),
                     ([0.25792, 0.38861], [0.61139, 0.74208]), ([0.90901, 0.95721], [0.04279, 0.09099]),
                     ([0.3556, 0.4556], [0.5444, 0.6444])]
                ]
            ]
        pass

    def get_ExtremeExpert_case(self):
        self.data = [
            [   # EX 1 比较极端的专家
                [([0.81539, 0.91785], [0.17128, 0.28772]), ([0.12374, 0.22949], [0.55729, 0.67911]), ([0.84635, 0.95753], [0.10662, 0.21768]), ([0.73433, 0.90407], [0.20174, 0.23691]), ([0.84604, 0.93614], [0.10258, 0.23917])],
                [([0.79202, 0.84776], [0.10917, 0.11366]), ([0.29818, 0.3131], [0.47785, 0.64139]), ([0.14316, 0.29861], [0.78271, 0.8032]), ([0.01997, 0.33824], [0.71369, 0.85874]), ([0.76598, 0.84382], [0.14362, 0.25493])],
                [([0.89511, 0.90987], [0.1782, 0.21547]), ([0.19584, 0.25518], [0.4043, 0.51519]), ([0.24707, 0.43495], [0.71766, 0.74854]), ([0.08338, 0.28006], [0.1259, 0.34247]), ([0.81361, 0.91613], [0.0414, 0.14519])],
                [([0.09222, 0.1264], [0.78533, 0.81673]), ([0.24999, 0.31601], [0.63687, 0.7492]), ([0.13707, 0.23335], [0.75133, 0.88383]), ([0.70681, 0.77778], [0.00605, 0.18418]), ([0.17279, 0.25538], [0.66516, 0.87157])],
                [([0.1876, 0.28807], [0.42117, 0.57172]), ([0.1311, 0.19959], [0.7644, 0.81178]), ([0.06145, 0.20426], [0.86783, 0.89045]), ([0.74275, 0.86356], [0.14231, 0.25652]), ([0.21145, 0.30498], [0.89949, 0.91677])]],
            [   # EX 2
                [([0.08292, 0.50117], [0.50667, 0.50678]), ([0.11911, 0.15722], [0.2465, 0.5836]), ([0.27517, 0.55611], [0.06207, 0.6149]), ([0.41671, 0.54341], [0.13513, 0.41691]), ([0.31527, 0.8603], [0.06826, 0.10229])],
                [([0.03052, 0.46502], [0.24415, 0.27349]), ([0.08943, 0.24967], [0.0733, 0.85585]), ([0.06586, 0.15391], [0.27309, 0.5778]), ([0.70083, 0.72303], [0.14473, 0.1616]), ([0.04556, 0.60773], [0.31085, 0.60264])],
                [([0.3336, 0.54359], [0.57898, 0.66419]), ([0.50225, 0.67613], [0.25866, 0.63075]), ([0.03535, 0.09916], [0.28096, 0.75142]), ([0.34816, 0.36317], [0.43975, 0.70919]), ([0.03995, 0.23967], [0.22888, 0.64908])],
                [([0.0236, 0.58972], [0.18763, 0.43452]), ([0.25989, 0.61085], [0.55935, 0.63375]), ([0.09874, 0.46924], [0.10619, 0.43182]), ([0.39735, 0.86846], [0.27444, 0.36828]), ([0.22518, 0.62759], [0.28436, 0.54246])],
                [([0.06448, 0.56847], [0.45287, 0.46481]), ([0.51336, 0.69668], [0.24052, 0.68994]), ([0.21242, 0.37388], [0.55602, 0.69149]), ([0.32786, 0.37202], [0.48703, 0.85157]), ([0.01335, 0.68743], [0.36652, 0.6513])]],
            [   # EX 3 比较极端的专家
                [([0.18760, 0.25807], [0.42117, 0.57172]), ([0.10011, 0.15959], [0.76434, 0.81178]), ([0.06145, 0.20426], [0.89783, 0.92045]), ([0.74275, 0.86356], [0.14231, 0.25652]), ([0.21145, 0.30498], [0.89949, 0.91677])],
                [([0.79202, 0.89776], [0.10917, 0.11366]), ([0.29818, 0.31313], [0.47785, 0.64139]), ([0.14316, 0.29861], [0.78271, 0.82323]), ([0.01997, 0.33824], [0.71369, 0.85874]), ([0.76598, 0.84382], [0.14362, 0.25493])],
                [([0.89511, 0.93987], [0.17820, 0.21547]), ([0.19584, 0.25518], [0.40431, 0.51519]), ([0.24707, 0.43495], [0.71766, 0.74854]), ([0.08338, 0.28006], [0.1259, 0.34247]), ([0.81361, 0.91613], [0.0414, 0.14519])],
                [([0.71539, 0.81785], [0.17128, 0.28772]), ([0.12374, 0.22949], [0.55729, 0.67911]), ([0.84635, 0.95753], [0.10662, 0.16768]), ([0.83433, 0.90407], [0.20174, 0.21691]), ([0.84604, 0.93614], [0.10258, 0.23917])],
                [([0.09222, 0.10642], [0.78533, 0.81673]), ([0.24999, 0.31601], [0.63687, 0.74921]), ([0.13707, 0.23335], [0.79133, 0.88383]), ([0.71681, 0.78778], [0.00605, 0.18418]), ([0.17279, 0.25538], [0.66516, 0.87157])]],
            [   # EX 4
                [([0.38482, 0.59575], [0.35219, 0.48612]), ([0.41801, 0.57467], [0.49089, 0.65312]), ([0.11792, 0.52424], [0.50612, 0.56736]), ([0.0109, 0.70203], [0.07528, 0.65795]), ([0.30154, 0.37814], [0.45785, 0.48269])],
                [([0.40329, 0.43068], [0.2141, 0.71721]), ([0.54615, 0.70745], [0.16609, 0.62955]), ([0.17022, 0.27334], [0.45896, 0.61288]), ([0.20432, 0.35008], [0.37323, 0.77666]), ([0.27215, 0.54495], [0.16648, 0.27483])],
                [([0.55314, 0.77362], [0.22225, 0.28842]), ([0.45532, 0.58076], [0.16296, 0.45268]), ([0.3747, 0.43067], [0.1716, 0.3428]), ([0.24098, 0.66626], [0.17639, 0.49934]), ([0.51107, 0.84219], [0.35932, 0.38067])],
                [([0.47004, 0.49648], [0.26814, 0.27869]), ([0.16823, 0.26383], [0.54001, 0.76511]), ([0.3602, 0.50915], [0.02614, 0.804]), ([0.34787, 0.50647], [0.07668, 0.32178]), ([0.35244, 0.42263], [0.21496, 0.54331])],
                [([0.22924, 0.29893], [0.39115, 0.71188]), ([0.04813, 0.26927], [0.25721, 0.62332]), ([0.19874, 0.22589], [0.06198, 0.7587]), ([0.68655, 0.75794], [0.39796, 0.46273]), ([0.19835, 0.41986], [0.39635, 0.41319])]],
            [   # EX 5
                [([0.18411, 0.21906], [0.33255, 0.3516]), ([0.20715, 0.80472], [0.366, 0.55215]), ([0.15686, 0.32514], [0.14282, 0.36131]), ([0.49251, 0.88319], [0.15339, 0.4222]), ([0.21586, 0.79665], [0.19867, 0.49292])],
                [([0.21437, 0.3538], [0.3222, 0.68541]), ([0.37916, 0.38119], [0.10832, 0.22863]), ([0.25253, 0.53417], [0.28444, 0.44973]), ([0.32301, 0.5474], [0.06542, 0.26617]), ([0.02257, 0.53035], [0.69609, 0.74263])],
                [([0.34673, 0.83255], [0.09287, 0.51008]), ([0.56767, 0.57715], [0.09044, 0.80749]), ([0.38145, 0.8296], [0.00509, 0.55399]), ([0.15698, 0.25618], [0.17427, 0.5175]), ([0.73008, 0.91341], [0.11723, 0.16834])],
                [([0.4328, 0.70028], [0.18953, 0.64723]), ([0.67724, 0.76428], [0.40697, 0.44846]), ([0.14427, 0.45802], [0.10378, 0.48264]), ([0.5448, 0.70256], [0.18542, 0.46483]), ([0.30095, 0.5313], [0.45593, 0.71895])],
                [([0.38742, 0.39864], [0.49778, 0.8052]), ([0.48972, 0.58236], [0.31163, 0.63053]), ([0.02515, 0.12138], [0.10282, 0.17541]), ([0.3162, 0.39469], [0.76003, 0.8422]), ([0.49836, 0.80268], [0.32657, 0.45343])]]
        ]
        pass

    def get_Uniform_case(self):
        """
            function : 正态分布（均值=0.5，方差=0.5）的数据，5个方案，5个专家，5个属性
            remark   : 正态分布（均值=0.5，方差=0.5）的数据，5个方案，5个专家，5个属性
            return   : 正态分布的 5 x 5 x 5 的数据案例，以及专家权重和属性权重
        """
        self.data = [
            [
                [([0.07783, 0.10466], [0.21909, 0.95588]), ([0.29138, 0.30904], [0.08246, 0.12432]), ([0.39974, 0.50274], [0.41253, 0.6775]), ([0.46858, 0.5955], [0.22556, 0.6098]), ([0.04577, 0.15586], [0.29201, 0.61284])],
                [([0.18682, 0.64187], [0.18358, 0.50736]), ([0.19994, 0.47421], [0.05312, 0.27358]), ([0.15545, 0.33596], [0.01607, 0.47247]), ([1e-05, 0.49709], [0.21372, 0.29133]), ([0.85005, 0.91171], [0.08139, 0.18338])],
                [([0.2721, 0.301], [0.82409, 0.9265]), ([0.21833, 0.53718], [0.32025, 0.52659]), ([0.43912, 0.69358], [0.13229, 0.56586]), ([0.15785, 0.25714], [0.031, 0.94815]), ([0.51301, 0.72891], [0.34944, 0.66842])],
                [([0.06548, 0.53486], [0.07731, 0.28703]), ([0.1265, 0.16805], [0.8132, 0.97351]), ([0.48694, 0.68897], [0.24227, 0.57921]), ([0.04022, 0.30405], [0.36197, 0.55462]), ([0.35712, 0.8474], [0.2719, 0.46513])],
                [([0.45351, 0.72062], [0.15913, 0.29433]), ([0.10792, 0.78564], [0.42525, 0.45034]), ([0.34996, 0.56558], [0.78235, 0.80077]), ([0.80348, 0.94098], [0.26167, 0.26666]), ([0.20491, 0.35558], [0.02509, 0.60288])]],
            [
                [([0.14189, 0.57539], [0.37893, 0.64316]), ([0.09659, 0.12812], [0.66317, 0.96436]), ([0.20239, 0.33925], [0.51342, 0.77622]), ([0.35249, 0.86395], [0.10313, 0.33276]), ([0.619, 0.81236], [0.28776, 0.44062])],
                [([0.06436, 0.16606], [0.31703, 0.82127]), ([0.15762, 0.78442], [0.3342, 0.45087]), ([0.30618, 0.76099], [0.34801, 0.41785]), ([0.32159, 0.36077], [0.38238, 0.51464]), ([0.18282, 0.32684], [0.0862, 0.27865])],
                [([0.14292, 0.4289], [0.08406, 0.21893]), ([0.3518, 0.54852], [0.20599, 0.43438]), ([0.35922, 0.63544], [0.05809, 0.69658]), ([0.48378, 0.71917], [0.17846, 0.46689]), ([0.37476, 0.74575], [0.09525, 0.54294])],
                [([0.16391, 0.54013], [0.62107, 0.74908]), ([0.08048, 0.57837], [0.33653, 0.57174]), ([0.71513, 0.84345], [0.06215, 0.12445]), ([0.0583, 0.79075], [0.31173, 0.41877]), ([0.08797, 0.29083], [0.20706, 0.48805])],
                [([0.49282, 0.77103], [0.34784, 0.51116]), ([0.03029, 0.29837], [0.13037, 0.53785]), ([0.47364, 0.57636], [0.13684, 0.14083]), ([0.05311, 0.33579], [0.52342, 0.7156]), ([0.49672, 0.58786], [0.60565, 0.77621])]],
            [
                [([0.17006, 0.51867], [0.0107, 0.85299]), ([0.27936, 0.62292], [0.09347, 0.69268]), ([0.35377, 0.45396], [0.59199, 0.83696]), ([0.2084, 0.64488], [0.29936, 0.45914]), ([0.14589, 0.20351], [0.30078, 0.31275])],
                [([0.3295, 0.56135], [0.53225, 0.75]), ([0.1381, 0.67674], [0.13454, 0.597]), ([0.09306, 0.37679], [0.58225, 0.63661]), ([0.1003, 0.3444], [0.08872, 0.93799]), ([0.42121, 0.72985], [0.1538, 0.60024])],
                [([0.24973, 0.4467], [0.24544, 0.87285]), ([0.65408, 0.65713], [0.58619, 0.62943]), ([0.11908, 0.58221], [0.73196, 0.7784]), ([0.5498, 0.6817], [0.10814, 0.52392]), ([0.29791, 0.59253], [0.23969, 0.41493])],
                [([0.19813, 0.76475], [0.11139, 0.47541]), ([0.11296, 0.11746], [0.55123, 0.84443]), ([0.24311, 0.44607], [0.69518, 0.73854]), ([0.04855, 0.14366], [0.17, 0.22087]), ([0.22611, 0.32094], [0.26041, 0.67824])],
                [([0.28311, 0.57675], [0.30093, 0.46852]), ([0.84038, 0.84108], [0.24845, 0.46079]), ([0.00998, 0.20364], [0.09039, 0.97259]), ([0.01716, 0.50771], [0.2925, 0.56385]), ([0.155, 0.79238], [0.02562, 0.59973])]],
            [
                [([0.2004, 0.68493], [0.05755, 0.20565]), ([0.01454, 0.31772], [0.73532, 0.8053]), ([0.2256, 0.55361], [0.01799, 0.41812]), ([0.60962, 0.74732], [0.18132, 0.19389]), ([0.24919, 0.42094], [0.41552, 0.70627])],
                [([0.53531, 0.5357], [0.36347, 0.78401]), ([0.59716, 0.716], [0.11225, 0.25316]), ([0.07285, 0.30517], [0.11265, 0.5965]), ([0.67423, 0.81865], [0.28396, 0.54976]), ([0.31232, 0.37437], [0.18797, 0.76388])],
                [([0.07383, 0.34174], [0.03184, 0.19454]), ([0.01679, 0.04549], [0.40526, 0.82909]), ([0.05518, 0.13858], [0.50934, 0.6265]), ([0.11009, 0.65474], [0.31074, 0.37844]), ([0.22772, 0.36226], [0.45123, 0.62771])],
                [([0.07021, 0.19991], [0.39763, 0.84656]), ([0.23381, 0.79256], [0.116, 0.2858]), ([0.0661, 0.08086], [0.40639, 0.78144]), ([0.34484, 0.5336], [0.14037, 0.21555]), ([0.41335, 0.61251], [0.1289, 0.34533])],
                [([0.27884, 0.70636], [0.50754, 0.59182]), ([0.36517, 0.4696], [0.37202, 0.72477]), ([0.68956, 0.72934], [0.34899, 0.62491]), ([0.36381, 0.79365], [0.31657, 0.53409]), ([0.03117, 0.75481], [0.21572, 0.57017])]],
            [
                [([0.06145, 0.25135], [0.13757, 0.72368]), ([0.68986, 0.84261], [0.30214, 0.40904]), ([0.02989, 0.17306], [0.06951, 0.84765]), ([0.20591, 0.64888], [0.40746, 0.76069]), ([0.03685, 0.42908], [0.37738, 0.71633])],
                [([0.31667, 0.64172], [0.2495, 0.45923]), ([0.04622, 0.14914], [0.70998, 0.88772]), ([0.0915, 0.83718], [0.10231, 0.39317]), ([0.17697, 0.19236], [0.5971, 0.68756]), ([0.25519, 0.37025], [0.08281, 0.62982])],
                [([0.59948, 0.9149], [0.13659, 0.14527]), ([0.18557, 0.19538], [0.83542, 0.90053]), ([0.04915, 0.8835], [0.26227, 0.28815]), ([0.23068, 0.78343], [0.22656, 0.5799]), ([0.68574, 0.69028], [0.5158, 0.53305])],
                [([0.26247, 0.66196], [0.49067, 0.57476]), ([0.24337, 0.28133], [0.37757, 0.71946]), ([0.38255, 0.42357], [0.62785, 0.65354]), ([0.38826, 0.67221], [0.58756, 0.72481]), ([0.69254, 0.69915], [0.3034, 0.64036])],
                [([0.09544, 0.62901], [0.266, 0.59231]), ([0.40761, 0.70966], [0.02196, 0.14347]), ([0.10805, 0.77517], [0.09552, 0.60011]), ([0.22974, 0.30335], [0.45454, 0.8927]), ([0.66347, 0.67], [0.55628, 0.74103])]]
        ]
        pass

    # 使用随机生成的数据集
    # 对随机生成矩阵，的，功能函数
    def array_trans_fuzzy(self, rand_array):
        """
            function    : 将随机的生成的 m,n,k 的矩阵 —— 数值为 [0, 9] —— 因为评分范围 [0,9]
            rand_array  : m x n x k 的矩阵 —— 元素为实数的
            process     : 过程为，将矩阵中数做边界处理 小于0转为 0.00111 大于9的转为 8.99999
                          以 1.2 为例子, 先向下取整为 1 做 base, 评分值 1 对应
                          评分值 1 对应 ([0.10, 0.20], [0.80, 0.90])
                          评分值 2 对应  ([0.20, 0.35], [0.65, 0.80]),
                          算两个评分对模糊每个 u，v 之间 差值 dis(u1,u2,v1,v2)
                          用 1.2-1=0.2 做权重, 计算结果值
                          以 u1 为例，u1 = 0.2*(0.2-0.1) + 0.1
                          以 v1 为例，v1 = 0.2*(0.65-0.80) + 0.80
            return      :  m x n x k 的 元素为区间值广义正交模糊数 的服从某种分布的数据集
        """
        # 导入库
        import numpy as np

        # 传入容器转为 np 的矩阵
        rand_array = np.array(rand_array)
        # print("befor time :\n", rand_array>9)
        max = np.max(rand_array)
        rand_array = rand_array / max * 9
        # print("after time :\n", rand_array>9)

        # 做个溢出处理处理
        rand_array[rand_array <= 0] = 0.01111
        rand_array[rand_array >= 9] = 8.99999
        # 做一个向下取整的处理
        temp_array = np.floor(rand_array)

        # 矩阵元素转换
        result_array = []   # list 空容器
        for i in range(len(rand_array)):  # 变量每个元素
            result_array.append([])
            for j in range(len(rand_array[i])):
                result_array[i].append([])
                for k in range(len(rand_array[i][j])):
                    # 开始转换
                    # 去 base 和 up=base+1 对应的值和模糊数
                    base = temp_array[i][j][k]
                    # 获取差值
                    # temp_array 由 rand_array 向下取整得到的 , 所以差值为 [0, 1] ——> 完成归一化
                    dist = rand_array[i][j][k] - temp_array[i][j][k]
                    element_bs = self.data_dict[base]
                    element_up = self.data_dict[base + 1]
                    # 加权换算模糊数的 隶属度区间 和 费隶属度区间
                    u_bs_f, u_bs_r, v_bs_f, v_bs_r = *element_bs[0], *element_bs[1]
                    u_up_f, u_up_r, v_up_f, v_up_r = *element_up[0], *element_up[1]
                    # method = lambda base, up , dist : round((up-base)*dist+base, 5)
                    # u_re_f = method(u_bs_f, u_up_f, dist)
                    u_re_f = round((u_up_f - u_bs_f) * dist + u_bs_f, 5)
                    u_re_r = round((u_up_r - u_bs_r) * dist + u_bs_r, 5)
                    v_re_f = round((v_up_f - v_bs_f) * dist + v_bs_f, 5)
                    v_re_r = round((v_up_r - v_bs_r) * dist + v_bs_r, 5)
                    # 生成结果值，并加入到原型实数对应位置
                    result = ([u_re_f, u_re_r], [v_re_f, v_re_r])
                    result_array[i][j].append(result)
        return result_array

    def show_distribution(self, rand_array, showimg = True, saveimg=False, savepath="distribute.jpeg"):
        """
            function    : 将随机的生成的 m,n,k 的矩阵 —— 绘制成 3d 分布图
            rand_array  : m x n x k 的矩阵 —— 元素为实数的

        """
        import matplotlib.pyplot as plt
        import numpy as np
        # 初始化画布
        fig = plt.figure(figsize=(10, 8))
        ax = fig.add_subplot(projection="3d")

        ax.set_xlabel("exper")
        ax.set_ylabel("project")
        ax.set_zlabel("attribute")

        for i in range(len(rand_array)):
            x = np.array([i]*len(rand_array[i]))
            for j in range(len(rand_array[i])):
                y = np.arange(len(rand_array[i][j]))
                ax.scatter(x, y, rand_array[i][j], marker='^')
        if saveimg:
            plt.savefig(savepath)
        if showimg:
            plt.show()
        plt.close(fig)
        pass

    def show_array(self, array):
        """
            function: 描述输出矩阵
        """
        for index, items in enumerate(array):
            print("第{:}位专家对每个方案每个属性判断:".format(str(index + 1)))
            for item in items:
                print(item)

    # 依据概率分布
    def get_Gaussian_random(self, mean=4.5, std=3, show_distri = False, get_return = False):
        """
            function    : 随机生成服从正态分布的
            mean        : 正态分布的均值  —— 设置在数据范围中间
            std         : 正态分布的标准差 —— 适宜即可
            show_distri : 是否需要绘制三维散点图
            get_return  : 是否需要返回结果
            return      : m x n x k 的 元素为区间值广义正交模糊数决策集合，是服从某种分布的数据集
        """
        import numpy as np
        size = self.size

        # 生成正态分布的数据 —— 生成数值为 [0,9]，最好
        rand_array = np.random.normal(mean, std, size)
        # print(rand_array)

        # 绘制成 3d 散点图
        if show_distri:
            self.show_distribution(rand_array, show_distri)

        # 将矩阵转为模糊数矩阵
        result_array = self.array_trans_fuzzy(rand_array)
        # 替换数据
        self.data = result_array
        self.data_assess_value = rand_array

        if get_return:
            return result_array
        pass

    def get_Uniform_random(self, low=0, high=9, show_distri=False, get_return=False):
        """
            function    : 随机生成服从均值分布的
            low         : 均匀分布的最低值 —— 似乎没包含
            high        : 均匀分布的最高值 —— 似乎没包含
            show_distri : 是否需要绘制三维散点图
            get_return  : 是否需要返回结果
            return      : m x n x k 的 元素为区间值广义正交模糊数决策集合，是服从某种分布的数据集
        """
        import numpy as np

        size = self.size    # 获取三维矩阵的维度 size

        # 均匀分布 生成shape为size 的随机矩阵
        rand_array = np.random.uniform(low, high, size)
        # print(rand_array) # 测试

        # 将矩阵转为模糊数矩阵
        result_array = self.array_trans_fuzzy(rand_array)
        # 替换数据
        self.data = result_array
        self.data_assess_value = rand_array

        # 绘制分布图
        if show_distri:
            self.show_distribution(rand_array,show_distri)

        if get_return:
            return result_array
        pass

    def get_Poisson_random(self, mean=4, show_distri=False, get_return=False):
        """
            function     : 随机生成服从泊松分布的
            mean         : 正态分布的均值  —— 设置在数据范围中间
            digit        : 将区间值扩大倍数
            show_distri  : 是否需要绘制三维散点图
            get_return   : 是否需要返回结果
            return       : m x n x k 的 元素为区间值广义正交模糊数决策集合，是服从某种分布的数据集
        """
        import numpy as np
        # size = [10, 10, 10]
        size = self.size
        # 生成正态分布的数据 —— 生成数值为 [0,9]，最好
        rand_array = np.random.poisson(lam=mean, size=size)   # lam为λ size为k

        # print(rand_array)

        # 绘制成 3d 散点图
        if show_distri:
            self.show_distribution(rand_array, show_distri)

        # 将矩阵转为模糊数矩阵
        result_array = self.array_trans_fuzzy(rand_array)
        # 替换数据
        self.data = result_array
        self.data_assess_value = rand_array

        if get_return:
            return result_array
        pass

    def get_Exponential_random(self, scale=4, show_distri=False, get_return=False):
        """
            function    : 随机生成服从指数分布的多属性决策群
            return      : m x n x k 的 元素为区间值广义正交模糊数决策集合，是服从某种分布的数据集
        """
        import numpy as np
        # size = [10, 10, 10]
        size = self.size
        # 生成正态分布的数据 —— 生成数值为 [0,9]，最好
        rand_array = np.random.exponential(scale=scale, size=size)  # lam为λ size为k

        # 绘制成 3d 散点图
        if show_distri:
            self.show_distribution(rand_array, show_distri)

        # 将矩阵转为模糊数矩阵
        result_array = self.array_trans_fuzzy(rand_array)
        # 替换数据
        self.data = result_array
        self.data_assess_value = rand_array

        if get_return:
            return result_array
        pass

    def get_Lognormal_random(self, mean=2, signma=1, show_distri=False, get_return=False):
        """
            function    : 随机生成服从对数正态分布的多属性决策群
            return      : m x n x k 的 元素为区间值广义正交模糊数决策集合，是服从某种分布的数据集
        """
        import numpy as np
        # size = [10, 10, 10]
        size = self.size
        # 生成对数正态分布的数据 —— 生成数值为 [0,9]，最好
        rand_array = np.random.lognormal(mean=mean, sigma=signma, size=size)  # 期望、标准差、 size为k

        # 绘制成 3d 散点图
        if show_distri:
            self.show_distribution(rand_array, show_distri)

        # 将矩阵转为模糊数矩阵
        result_array = self.array_trans_fuzzy(rand_array)
        # 替换数据
        self.data = result_array
        self.data_assess_value = rand_array

        if get_return:
            return result_array
        pass


    # 以下待完成的

    def get_Gamma_random(self, alpha=3, beta=3, show_distri=False, get_return=False):
        """
            function    : 随机生成服从伽马分布的多属性决策群
            return      : m x n x k 的 元素为区间值广义正交模糊数决策集合，是服从某种分布的数据集
            alpha       : 影响分布的峰起状态, 形状参数
            beta        : 影响分布的散度情况, 尺度参数
        """
        import numpy as np
        # size = [10, 10, 10]
        size = self.size
        # 生成对数正态分布的数据 —— 生成数值为 [0,9]，最好
        rand_array = np.random.gamma(shape=alpha, scale=beta, size=size)  # 期望、标准差、 size为k

        # 绘制成 3d 散点图
        if show_distri:
            self.show_distribution(rand_array, show_distri)

        # 将矩阵转为模糊数矩阵
        result_array = self.array_trans_fuzzy(rand_array)
        # 替换数据
        self.data = result_array
        self.data_assess_value = rand_array

        if get_return:
            return result_array


if __name__=='__main__':
    # data=Distribute().get_Gaussian_random(get_return=True)
    # data = [[([0.65, 0.80], [0.20, 0.35]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35]),([0.45, 0.55], [0.45, 0.55]),([0.45, 0.55], [0.45, 0.55])],
    #         [([0.80, 0.90], [0.10, 0.20]),([0.65, 0.80], [0.20, 0.35]),([0.80, 0.90], [0.10, 0.20]),([0.65, 0.80], [0.20, 0.35]),([0.80, 0.90], [0.10, 0.20])],
    #         [([0.55, 0.65], [0.35, 0.45]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35])],
    #         [([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.45, 0.55], [0.45, 0.55]),([0.35, 0.45], [0.55, 0.65])],
    #         [([0.20, 0.35], [0.65, 0.80]),([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.20, 0.35], [0.65, 0.80]),([0.10, 0.20], [0.80, 0.90])]]

    # data = [[[([0.65, 0.80], [0.20, 0.35]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35]),([0.45, 0.55], [0.45, 0.55]),([0.45, 0.55], [0.45, 0.55])],
    #         [([0.80, 0.90], [0.10, 0.20]),([0.65, 0.80], [0.20, 0.35]),([0.80, 0.90], [0.10, 0.20]),([0.65, 0.80], [0.20, 0.35]),([0.80, 0.90], [0.10, 0.20])],
    #         [([0.55, 0.65], [0.35, 0.45]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35])],
    #         [([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.45, 0.55], [0.45, 0.55]),([0.35, 0.45], [0.55, 0.65])],
    #         [([0.20, 0.35], [0.65, 0.80]),([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.20, 0.35], [0.65, 0.80]),([0.10, 0.20], [0.80, 0.90])]],
    #         [[([0.35,0.45],[0.55,0.65]),([0.55,0.65],[0.35,0.45]),([0.10,0.20],[0.80,0.90]),([0.55,0.65],[0.35,0.45]),([0.35,0.45],[0.55,0.65])],
    #         [([0.65,0.80],[0.20,0.35]),([0.80,0.90],[0.10,0.20]),([0.45,0.55],[0.45,0.55]),([0.65,0.80],[0.20,0.35]),([0.80,0.90],[0.10,0.20])],
    #         [([0.45,0.55],[0.45,0.55]),([0.65,0.80],[0.20,0.35]),([0.45,0.55],[0.45,0.55]),([0.80,0.90],[0.10,0.20]),([0.45,0.55],[0.45,0.55])],
    #         [([0.20,0.35],[0.65,0.80]),([0.45,0.55],[0.45,0.55]),([0.35,0.45],[0.55,0.65]),([0.45,0.55],[0.45,0.55]),([0.35,0.45],[0.55,0.65])],
    #         [([0.10,0.20],[0.80,0.90]),([0.35,0.45],[0.55,0.65]), ([0.20,0.35],[0.65,0.80]),([0.10,0.20],[0.80,0.90]),([0.10,0.20],[0.80,0.90])]],
    #         [[([0.35,0.45],[0.55,0.65]),([0.45,0.55],[0.45,0.55]),([0.65,0.80],[0.20,0.35]),([0.55,0.65],[0.35,0.45]),([0.45,0.55],[0.45,0.55])],
    #         [([0.55,0.65],[0.35,0.45]),([0.80,0.90],[0.10,0.20]),([0.80,0.90],[0.10,0.20]),([0.65,0.80],[0.20,0.35]),([0.55,0.65],[0.35,0.45])],
    #         [([0.45,0.55],[0.45,0.55]),([0.55,0.65],[0.35,0.45]),([0.45,0.55],[0.45,0.55]),([0.55,0.65],[0.35,0.45]), ([0.45,0.55],[0.45,0.55])],
    #         [([0.35,0.45],[0.55,0.65]), ([0.20,0.35],[0.65,0.80]),([0.20,0.35],[0.65,0.80]),([0.45,0.55],[0.45,0.55]),([0.35,0.45],[0.55,0.65])],
    #         [ ([0.10,0.20],[0.80,0.90]),([0.10,0.20],[0.80,0.90]),([0.10,0.20],[0.80,0.90]), ([0.35,0.45],[0.55,0.65]), ([0.20,0.35],[0.65,0.80])]]]

    data = [[[([0.35, 0.45], [0.5, 0.65]),([0.8, 0.85], [0.15, 0.2]),([0.6, 0.7], [0.3, 0.4]),([0.7, 0.8], [0.2, 0.3]),([0.65, 0.7],[0.35, 0.4])],
            [([0.55, 0.6], [0.4, 0.5]),([0.9, 0.95], [0.1, 0.2]),([0.75, 0.85], [0.2, 0.3]),([0.85, 0.9], [0.1, 0.15]),([0.75, 0.8],[0.2, 0.3])],
            [([0.4, 0.5], [0.5, 0.6]),([0.85, 0.9], [0.1, 0.2]),([0.75, 0.8], [0.2, 0.3]),([0.8, 0.9], [0.1, 0.2]),([0.65, 0.75],[0.35, 0.4])],
            [([0.35, 0.4], [0.6, 0.65]),([0.75, 0.85], [0.25, 0.3]),([0.6, 0.65], [0.25, 0.3]),([0.7, 0.8], [0.2, 0.3]),([0.55, 0.65], [0.3, 0.4])],
            [([0.1, 0.2], [0.85, 0.9]),([0.65, 0.75], [0.3, 0.45]),([0.55, 0.6], [0.4, 0.5]),([0.6, 0.7], [0.3, 0.4]),([0.5, 0.6], [0.4, 0.5])]],
            [[([0.4, 0.45], [0.5, 0.6]),	([0.85, 0.9], [0.1, 0.2]),([0.65, 0.75], [0.3, 0.4])	,([0.75, 0.8], [0.2, 0.3]),	([0.6, 0.7], [0.2, 0.3])],
            [([0.5, 0.6], [0.4, 0.5]),	([0.9, 0.95], [0.15, 0.2]),([0.75, 0.8], [0.2, 0.3]),	([0.85, 0.95], [0.1, 0.15]),	([0.7, 0.8], [0.2, 0.3])],
            [([0.4, 0.5], [0.5, 0.6]),([0.85, 0.95], [0.1, 0.2]),([0.7, 0.8], [0.2, 0.3]),([0.85, 0.9], [0.1, 0.2])	,([0.6, 0.75], [0.3, 0.35])],
            [([0.35, 0.45], [0.55, 0.65]),	([0.7, 0.85], [0.2, 0.3])	,([0.65, 0.7], [0.3, 0.45]),	([0.7, 0.8], [0.2, 0.3]),	([0.6, 0.65], [0.3, 0.4])],
            [([0.3, 0.4], [0.6, 0.7]),([0.7, 0.85], [0.2, 0.3]),([0.55, 0.65], [0.35, 0.4])	,([0.6, 0.7], [0.3, 0.35]),([0.5, 0.6], [0.4, 0.5])]],
            [[([0.4, 0.5], [0.5, 0.6]),([0.8, 0.85], [0.15, 0.25]),([0.7, 0.8], [0.25, 0.3])	,([0.75, 0.85], [0.2, 0.3])	,([0.6, 0.7], [0.35, 0.4])],
            [([0.5, 0.6], [0.4, 0.5]),([0.9, 0.95], [0.1, 0.2])	,([0.75, 0.85], [0.2, 0.35]),([0.85, 0.95], [0.1, 0.15]),([0.7, 0.8], [0.2, 0.3])],
            [([0.5, 0.65], [0.4, 0.5]),([0.85, 0.95], [0.1, 0.2]),([0.75, 0.8], [0.2, 0.3]),([0.85, 0.9], [0.1, 0.15]),	([0.7, 0.8], [0.2, 0.3])],
            [([0.35, 0.4], [0.6, 0.65]),([0.75, 0.85], [0.15, 0.25]),([0.6, 0.7], [0.3, 0.4]),([0.7, 0.8], [0.2, 0.3]),([0.6, 0.65], [0.3, 0.35])],
            [([0.3, 0.4], [0.5, 0.6]),([0.7, 0.8], [0.2, 0.3]),([0.5, 0.65], [0.4, 0.5]),([0.65, 0.7], [0.2, 0.3]),([0.5, 0.6], [0.4, 0.5])]]]

    data =[ [[([0.65, 0.80], [0.20, 0.35]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35]),([0.45, 0.55], [0.45, 0.55]),([0.45, 0.55], [0.45, 0.55])],
            [([0.80, 0.90], [0.10, 0.20]),([0.65, 0.80], [0.20, 0.35]),([0.80, 0.90], [0.10, 0.20]),([0.65, 0.80], [0.20, 0.35]),([0.80, 0.90], [0.10, 0.20])],
            [([0.55, 0.65], [0.35, 0.45]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35]),([0.55, 0.65], [0.35, 0.45]),([0.65, 0.80], [0.20, 0.35])],
            [([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.45, 0.55], [0.45, 0.55]),([0.35, 0.45], [0.55, 0.65])],
            [([0.20, 0.35], [0.65, 0.80]),([0.35, 0.45], [0.55, 0.65]),([0.35, 0.45], [0.55, 0.65]),([0.20, 0.35], [0.65, 0.80]),([0.10, 0.20], [0.80, 0.90])]],
            [[([0.35,0.45],[0.55,0.65]),([0.55,0.65],[0.35,0.45]),([0.10,0.20],[0.80,0.90]),([0.55,0.65],[0.35,0.45]),([0.35,0.45],[0.55,0.65])],
            [([0.65,0.80],[0.20,0.35]),([0.80,0.90],[0.10,0.20]),([0.45,0.55],[0.45,0.55]),([0.65,0.80],[0.20,0.35]),([0.80,0.90],[0.10,0.20])],
            [([0.45,0.55],[0.45,0.55]),([0.65,0.80],[0.20,0.35]),([0.45,0.55],[0.45,0.55]),([0.80,0.90],[0.10,0.20]),([0.45,0.55],[0.45,0.55])],
            [([0.20,0.35],[0.65,0.80]),([0.45,0.55],[0.45,0.55]),([0.35,0.45],[0.55,0.65]),([0.45,0.55],[0.45,0.55]),([0.35,0.45],[0.55,0.65])],
            [([0.10,0.20],[0.80,0.90]),([0.35,0.45],[0.55,0.65]), ([0.20,0.35],[0.65,0.80]),([0.10,0.20],[0.80,0.90]),([0.10,0.20],[0.80,0.90])]],
            [[([0.35,0.45],[0.55,0.65]),([0.45,0.55],[0.45,0.55]),([0.65,0.80],[0.20,0.35]),([0.55,0.65],[0.35,0.45]),([0.45,0.55],[0.45,0.55])],
            [([0.55,0.65],[0.35,0.45]),([0.80,0.90],[0.10,0.20]),([0.80,0.90],[0.10,0.20]),([0.65,0.80],[0.20,0.35]),([0.55,0.65],[0.35,0.45])],
            [([0.45,0.55],[0.45,0.55]),([0.55,0.65],[0.35,0.45]),([0.45,0.55],[0.45,0.55]),([0.55,0.65],[0.35,0.45]), ([0.45,0.55],[0.45,0.55])],
            [([0.35,0.45],[0.55,0.65]), ([0.20,0.35],[0.65,0.80]),([0.20,0.35],[0.65,0.80]),([0.45,0.55],[0.45,0.55]),([0.35,0.45],[0.55,0.65])],
            [ ([0.10,0.20],[0.80,0.90]),([0.10,0.20],[0.80,0.90]),([0.10,0.20],[0.80,0.90]), ([0.35,0.45],[0.55,0.65]), ([0.20,0.35],[0.65,0.80])]]]

    data = [[[([0.85, 0.9], [0.15, 0.25]), ([0.75, 0.85], [0.2, 0.3]), ([0.75, 0.8], [0.25, 0.3]),
             ([0.7, 0.75], [0.3, 0.35]),
             ([0.6, 0.65], [0.4, 0.5])],
            [([0.9, 0.95], [0.1, 0.2]), ([0.8, 0.85], [0.15, 0.2]), ([0.75, 0.85], [0.2, 0.3]), ([0.75, 0.8], [0.25, 0.3]),
             ([0.65, 0.7], [0.35, 0.45])],
            [([0.8, 0.85], [0.15, 0.2]), ([0.75, 0.8], [0.25, 0.3]), ([0.7, 0.75], [0.35, 0.4]), ([0.65, 0.7], [0.35, 0.4]),
             ([0.6, 0.65], [0.35, 0.4])],
            [([0.75, 0.85], [0.2, 0.3]), ([0.7, 0.75], [0.25, 0.3]), ([0.65, 0.75], [0.2, 0.3]), ([0.6, 0.65], [0.3, 0.4]),
             ([0.6, 0.65], [0.3, 0.4])],
            [([0.7, 0.8], [0.2, 0.3]), ([0.7, 0.75], [0.3, 0.4]), ([0.6, 0.7], [0.3, 0.4]), ([0.6, 0.65], [0.4, 0.5]),
             ([0.5, 0.6], [0.45, 0.55])]],
            [[([0.8, 0.85], [0.2, 0.25]), ([0.75, 0.8], [0.25, 0.3]), ([0.7, 0.75], [0.25, 0.3]),
             ([0.65, 0.75], [0.25, 0.35]),
             ([0.6, 0.7], [0.3, 0.4])],
            [([0.85, 0.9], [0.1, 0.2]), ([0.75, 0.85], [0.2, 0.3]), ([0.7, 0.8], [0.25, 0.3]), ([0.7, 0.8], [0.2, 0.3]),
             ([0.6, 0.65], [0.35, 0.5])],
            [([0.75, 0.85], [0.2, 0.25]), ([0.75, 0.8], [0.2, 0.25]), ([0.65, 0.75], [0.25, 0.35]),
             ([0.65, 0.7], [0.25, 0.3]),
             ([0.55, 0.65], [0.4, 0.5])],
            [([0.75, 0.85], [0.25, 0.3]), ([0.7, 0.8], [0.2, 0.3]), ([0.7, 0.75], [0.3, 0.35]), ([0.65, 0.75], [0.3, 0.4]),
             ([0.6, 0.65], [0.4, 0.5])],
            [([0.75, 0.8], [0.25, 0.3]), ([0.7, 0.75], [0.35, 0.4]), ([0.65, 0.7], [0.35, 0.4]), ([0.6, 0.7], [0.4, 0.5]),
             ([0.55, 0.6], [0.4, 0.5])]],
            [[([0.75, 0.85], [0.15, 0.25]), ([0.75, 0.8], [0.2, 0.25]), ([0.7, 0.75], [0.25, 0.3]),
             ([0.65, 0.75], [0.3, 0.4]),
             ([0.55, 0.6], [0.45, 0.5])],
            [([0.8, 0.85], [0.15, 0.2]), ([0.75, 0.85], [0.2, 0.3]), ([0.75, 0.8], [0.25, 0.3]), ([0.7, 0.8], [0.2, 0.3]),
             ([0.6, 0.65], [0.4, 0.5])],
            [([0.75, 0.85], [0.2, 0.25]), ([0.7, 0.8], [0.2, 0.3]), ([0.7, 0.75], [0.35, 0.4]), ([0.65, 0.7], [0.35, 0.4]),
             ([0.6, 0.65], [0.35, 0.5])],
            [([0.75, 0.8], [0.2, 0.25]), ([0.7, 0.8], [0.25, 0.3]), ([0.7, 0.75], [0.3, 0.4]), ([0.65, 0.7], [0.3, 0.4]),
             ([0.5, 0.55], [0.45, 0.5])],
            [([0.75, 0.8], [0.2, 0.3]), ([0.7, 0.75], [0.2, 0.3]), ([0.65, 0.7], [0.35, 0.4]), ([0.6, 0.65], [0.35, 0.4]),
             ([0.55, 0.6], [0.45, 0.5])]],
            [[([0.8, 0.85], [0.1, 0.2]), ([0.75, 0.8], [0.2, 0.25]), ([0.7, 0.75], [0.25, 0.3]), ([0.65, 0.75], [0.3, 0.4]),
             ([0.5, 0.55], [0.45, 0.5])],
            [([0.85, 0.9], [0.15, 0.2]), ([0.8, 0.85], [0.15, 0.2]), ([0.75, 0.8], [0.25, 0.3]), ([0.7, 0.75], [0.2, 0.3]),
             ([0.65, 0.7], [0.3, 0.35])],
            [([0.75, 0.85], [0.2, 0.3]), ([0.75, 0.8], [0.25, 0.3]), ([0.65, 0.75], [0.3, 0.4]), ([0.65, 0.7], [0.35, 0.4]),
             ([0.55, 0.6], [0.45, 0.5])],
            [([0.75, 0.8], [0.25, 0.3]), ([0.7, 0.8], [0.25, 0.3]), ([0.7, 0.75], [0.35, 0.4]), ([0.65, 0.7], [0.35, 0.4]),
             ([0.55, 0.6], [0.4, 0.5])],
            [([0.7, 0.75], [0.2, 0.3]), ([0.65, 0.75], [0.3, 0.4]), ([0.6, 0.65], [0.4, 0.5]), ([0.55, 0.65], [0.5, 0.6]),
             ([0.45, 0.5], [0.5, 0.55])]]]
    data =[[
            [([0.85, 0.95], [0.1, 0.2]), ([0.8, 0.85], [0.2, 0.3]), ([0.8, 0.9], [0.1, 0.2]),
             ([0.63, 0.7], [0.3, 0.35]), ([0.68, 0.7], [0.28, 0.35])],
            [([0.9, 0.95], [0.1, 0.2]), ([0.75, 0.8], [0.2, 0.3]), ([0.85, 0.9], [0.1, 0.15]),
             ([0.67, 0.74], [0.25, 0.3]), ([0.73, 0.83], [0.2, 0.3])],
            [([0.8, 0.9], [0.1, 0.2]), ([0.64, 0.7], [0.3, 0.4]), ([0.7, 0.8], [0.2, 0.3]), ([0.65, 0.68], [0.3, 0.4]),
             ([0.68, 0.7], [0.3, 0.35])],
            [([0.7, 0.8], [0.21, 0.31]), ([0.65, 0.75], [0.2, 0.3]), ([0.7, 0.8], [0.2, 0.3]),
             ([0.55, 0.65], [0.33, 0.38]), ([0.67, 0.72], [0.23, 0.33])],
            [([0.6, 0.7], [0.22, 0.32]), ([0.68, 0.7], [0.3, 0.39]), ([0.54, 0.6], [0.3, 0.4]),
             ([0.58, 0.7], [0.3, 0.4]), ([0.66, 0.71], [0.24, 0.28])]
            ],[
                [([0.79, 0.89], [0.1, 0.25]), ([0.72, 0.81], [0.2, 0.29]), ([0.83, 0.87], [0.12, 0.2]),
                 ([0.6, 0.7], [0.32, 0.35]), ([0.64, 0.76], [0.28, 0.32])],
                [([0.92, 0.95], [0.1, 0.2]), ([0.74, 0.81], [0.2, 0.3]), ([0.85, 0.95], [0.1, 0.15]),
                 ([0.65, 0.7], [0.3, 0.37]), ([0.67, 0.85], [0.28, 0.35])],
                [([0.85, 0.9], [0.1, 0.2]), ([0.65, 0.7], [0.3, 0.4]), ([0.75, 0.85], [0.2, 0.3]),
                 ([0.6, 0.7], [0.35, 0.4]), ([0.65, 0.75], [0.32, 0.42])],
                [([0.8, 0.95], [0.1, 0.2]), ([0.65, 0.75], [0.3, 0.4]), ([0.7, 0.8], [0.2, 0.3]),
                 ([0.6, 0.7], [0.35, 0.45]), ([0.7, 0.8], [0.25, 0.35])],
                [([0.7, 0.82], [0.2, 0.3]), ([0.5, 0.55], [0.4, 0.5]), ([0.69, 0.75], [0.2, 0.35]),
                 ([0.54, 0.6], [0.4, 0.5]), ([0.65, 0.7], [0.33, 0.45])]
            ],[
                [([0.82, 0.9], [0.25, 0.27]), ([0.75, 0.85], [0.17, 0.27]), ([0.85, 0.9], [0.1, 0.2]),
                 ([0.63, 0.75], [0.3, 0.35]), ([0.65, 0.73], [0.3, 0.35])],
                [([0.91, 0.96], [0.11, 0.21]), ([0.75, 0.85], [0.2, 0.3]), ([0.85, 0.95], [0.1, 0.15]),
                 ([0.65, 0.73], [0.28, 0.34]), ([0.7, 0.76], [0.2, 0.3])],
                [([0.85, 0.9], [0.1, 0.2]), ([0.68, 0.75], [0.3, 0.4]), ([0.75, 0.8], [0.2, 0.3]),
                 ([0.6, 0.7], [0.3, 0.38]), ([0.62, 0.7], [0.29, 0.36])],
                [([0.75, 0.86], [0.2, 0.3]), ([0.69, 0.7], [0.3, 0.4]), ([0.7, 0.85], [0.2, 0.3]),
                 ([0.6, 0.65], [0.3, 0.4]), ([0.68, 0.72], [0.25, 0.37])],
                [([0.72, 0.86], [0.2, 0.3]), ([0.65, 0.75], [0.3, 0.38]), ([0.7, 0.8], [0.22, 0.34]),
                 ([0.55, 0.6], [0.4, 0.5]), ([0.62, 0.72], [0.35, 0.4])]
            ],[
                [([0.81, 0.84], [0.11, 0.22]), ([0.7, 0.79], [0.21, 0.29]), ([0.8, 0.85], [0.14, 0.24]),
                 ([0.6, 0.7], [0.3, 0.35]), ([0.62, 0.73], [0.28, 0.32])],
                [([0.89, 0.91], [0.12, 0.2]), ([0.7, 0.78], [0.22, 0.3]), ([0.81, 0.9], [0.12, 0.15]),
                 ([0.64, 0.7], [0.32, 0.37]), ([0.62, 0.75], [0.29, 0.37])],
                [([0.82, 0.89], [0.12, 0.2]), ([0.64, 0.7], [0.3, 0.4]), ([0.73, 0.82], [0.21, 0.31]),
                 ([0.59, 0.68], [0.36, 0.4]), ([0.67, 0.73], [0.35, 0.42])],
                [([0.79, 0.9], [0.12, 0.22]), ([0.62, 0.71], [0.34, 0.45]), ([0.72, 0.81], [0.21, 0.3]),
                 ([0.59, 0.62], [0.34, 0.45]), ([0.68, 0.79], [0.28, 0.35])],
                [([0.69, 0.8], [0.23, 0.31]), ([0.53, 0.59], [0.38, 0.47]), ([0.64, 0.71], [0.22, 0.35]),
                 ([0.52, 0.6], [0.4, 0.5]), ([0.64, 0.69], [0.32, 0.43])]
            ]]
    print(data)
